Generating a New Reality by Micheal Lanham

Generating a New Reality by Micheal Lanham

Author:Micheal Lanham
Language: eng
Format: epub
ISBN: 9781484270929
Publisher: Apress


7.

Finally, the training code should mostly be familiar aside from the model configuration. Consulting Figure 5-6 should help explain the code. We will focus on one key section, as shown here:mu, logvar = encoder(real_B)

encoded_z = reparameterization(mu, logvar)

fake_B = generator(real_A, encoded_z)

# Pixelwise loss of translated image by VAE

loss_pixel = mae_loss(fake_B, real_B)

# Kullback-Leibler divergence of encoded B

loss_kl = 0.5 * torch.sum(torch.exp(logvar) + mu ** 2 - logvar - 1)

# Adversarial loss

loss_VAE_GAN = D_VAE.compute_loss(fake_B, valid)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.